import { Injectable } from '@angular/core';
import { HttpClientService } from '../../../services/http-client.service';

@Injectable()
export class DetailService {

	constructor(
		public httpClient: HttpClientService

	) { }
	//新增产品基础信息
	baseInfoAdd(item) {
		// +'&pageSize='+item.pageSize+'&pageIndex='+item.pageIndex+'&sFundStatus='+item.sFundStatus
		return this.httpClient.post('/pms/v1/publicissue/publicBasic', item);
	}
	//新增产品审核信息
	checkInfoAdd(item) {
		// +'&pageSize='+item.pageSize+'&pageIndex='+item.pageIndex+'&sFundStatus='+item.sFundStatus
		return this.httpClient.post('/pms/v1/publicissue/publicissueExamine', item);
	}
	//编辑产品基础信息
	editBasic(item) {
		return this.httpClient.put('/pms/v1/publicissue/publicBasic', item);
	}
	//编辑产品审核信息
	editCheckInfo(item) {
		return this.httpClient.put('/pms/v1/publicissue/reviewAndReforms', item);
	}
	//查询单个产品基础信息
	getSingleProductInfo(nFundNo) {
		return this.httpClient.get('/pms/v1/publicissue/publicBasic/' + nFundNo);
	}
	//查询单个产品审核信息
	getSingleCheckInfo(nFundNo) {
		return this.httpClient.get('/pms/v1/publicissue/publicissueExamine/' + nFundNo);
	}
	// 获取附件树
	getFileTree(getBody) {
		return this.httpClient.get('/pms/v1/common/fundFile/attachTree', getBody);
	}
	// 获取文件历史版本
	getFileHistory(getBody) {
		return this.httpClient.get('/pms/v1/common/fundFile/versions/' + getBody);
	}
	// 删除附件
	delFile(putBody) {
		return this.httpClient.put('/pms/v1/common/fundFile/file/' + putBody);
	}
	// 修改附件名
	changeFileName(nAttachNo, newFileName) {
		return this.httpClient.put('/pms/v1/common/fundFile/file?nAttachNo=' + nAttachNo + '&attachName=' + newFileName);
	}
	// 获取状态树
	loadTree(getBody) {
		return this.httpClient.get('/pms/v1/publicissue/publicBasicTree/' + getBody.nFundNo);
	}
	// 基金经理
	getManagerList() {
		return this.httpClient.get('/pms/v1/common/manager/managerList');
	}
	// 获取备案机构、受托人、托管人下拉框值
    getDictionary() {
        return this.httpClient.get('/pms/v1/common/dict/getStrustee?sFundType=1');
    }
}
